<?php
class DelifeiyinAction extends UserAction{
	public $delifeiyin_config;
	public function _initialize() {
		parent::_initialize();
		$this->delifeiyin_config=M('delifeiyin');
		if (!$this->token){
			exit();
		}
	}
	public function index(){
		$config = $this->delifeiyin_config->where(array('token'=>$this->token))->find();
		if(IS_POST){
			$row['bianma']=$this->_post('bianma');
			$row['kay']=$this->_post('kay');
			$row['bianhao']=$this->_post('bianhao');
			$row['token']=$this->_post('token');
			$row['shangcheng']=$this->_post('shangcheng');
			if ($config){
				$where=array('token'=>$this->token);
				$this->delifeiyin_config->where($where)->save($row);
			}else {
				$this->delifeiyin_config->add($row);
			}
			$this->success('设置成功',U('Delifeiyin/index',$where));
		}else{
			$this->assign('config',$config);
			$this->display();
		}
	}
}


?>